import {Injectable} from "@angular/core";
import "rxjs/add/operator/map";
import "rxjs/add/operator/catch";
import {Http} from "@angular/http";
import {UrlData} from "../../common/urldata";
import {ExceptionHandler} from "../../common/exception.handler";
/**
 * 收藏
 */
@Injectable()
export class FileService {

  constructor(private http: Http, private exceptionHandler: ExceptionHandler, private urlData: UrlData) {
  }

  uploadImgByBase64(param: any) {
    return this.http
      .post(this.urlData.baseUrl + `v1/upload/img/base64` ,param)
      .map(response => response.json())
      .catch(err => this.exceptionHandler.handleError(err));
  }
}
